#include "HandModel.h"

void setFrustumMat(float l, float r, float b, float t, float n, float f, Eigen::Matrix4f &matrixProjection);

/* A class manage on creating OPENGL context and drawing hypothesis depth map  */
class HandModelRenderer
{
public:
	HandModelRenderer();
	~HandModelRenderer();

	GLFWwindow * window;

	HandModel rHand;
	Eigen::Vector3f * currentJoin; // Bien xac dinh khop hien tai (cho viec dieu khien tren man hinh)
	Eigen::Matrix4f matrixProjection;  // Ma tran huong nhin

	/*x+- 12.8 ; y+-7.48*/
	float screen_width;
	float screen_height;
	float pixel_per_mm;  // Ti le giua so pixel voi kich thuoc thuc cua tay
	float mm_per_Pixel;

	// Cac thong so de tao ma tran diem anh hinh chieu
	float frushtum_focal;//(pixels) ~ 400mm : 
	float frushtum_far;//(pixels) ~ 1400mm

	float m_RX,m_RY,m_RZ;
	float depth,posX,posY;
	
	void initializeGLContext();
/*! @brief Init the context for drawing
 */
	cv::Mat renderHandModel();
	void HandModelRenderer::terminateGLContext();
};